-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: shared post empty state #2615
base: main
Are you sure you want to change the base?
Conversation
@@ -21,6 +22,10 @@ const worker: Worker = { | |||
typeof flags === 'string' ? JSON.parse(flags as string) : flags; | |||
const { deletedBy } = parsedFlags; | |||
|
|||
if (deletedBy === DELETED_BY_WORKER) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
await queryRunner.query( | ||
`INSERT INTO "public"."post" ("id", "sourceId", "deleted", "shortId", "showOnFeed", "flags") VALUES ('404', 'unknown', true, '404', false, '{"visible": true, "showOnFeed": false, "sentAnalyticsReport": false}');`, | ||
); | ||
await queryRunner.query( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it!
.createQueryBuilder() | ||
.update() | ||
.where({ | ||
sharedPostId: post.id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure we have index for sharedPostId
Couple things that happen here:
a. If has commentary we set it to not show on feed
b. If no commentary we simply set as soft deleted, but add the new DELETED_BY_WORKER flag, this way no reputation is lost.